package com.cduestc.weatheractivity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

public class About extends AppCompatActivity {
    TextView tvSource;
    ImageButton ibBackMore;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);

        tvSource = this.findViewById(R.id.tvSource);

        ibBackMore = this.findViewById(R.id.ibBackMore);

        ibBackMore.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(About.this,More.class);
                startActivity(intent);
                finish();
            }
        });

        tvSource.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String data="https://www.sojson.com/api/weather.html";
                Uri uri = Uri.parse(data);
                Intent intent = new Intent();
                intent.setAction(Intent.ACTION_VIEW);
                intent.setData(uri);
                startActivity(intent);
            }
        });
    }
}